package com.example.helloword.background;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class BackgroudThreadpoolService {
    private static BackgroudThreadpoolService instance;
    private final ExecutorService theadpool= Executors.newCachedThreadPool();

    private BackgroudThreadpoolService() {
    }

    public static BackgroudThreadpoolService getInstance() {
        if (instance == null) {
            synchronized (BackgroudThreadpoolService.class) {
                if (instance == null)
                    instance = new BackgroudThreadpoolService();
            }
        }
        return instance;
    }

    public ExecutorService getTheadpool() {
        return theadpool;
    }
}
